/**
 * @author Fang Lu, fanglupku@gmail.com
 * 2011-5-12
 */
package com.autotag;

import java.io.File;

import sei.pku.wsdl_analyzer.WSDLFileAnalyzer;

public class WSDLDocumentFilter {
	public static void main(String args[]) {
		File WSDLDirFile = new File(
				"C:\\Users\\ftc\\Desktop\\ICSOC\\WSDL_FILE\\WSDL_FILE");
		File ErrorDirFile = new File(
				"C:\\Users\\ftc\\Desktop\\ICSOC\\WSDL_FILE\\ERROR_FILE");
		File[] files = WSDLDirFile.listFiles();
		WSDLFileAnalyzer wsdlFileAnalyzer = new WSDLFileAnalyzer();
		for (int i = 0; i < files.length; ++i) {
			System.out.println(files[i].getName());

			try{
				wsdlFileAnalyzer.analyzeWSDL(files[i].getAbsolutePath());
			}catch (Exception e) {
				File newFile = new File(ErrorDirFile.getAbsoluteFile() + "\\"
						+ files[i].getName());
				System.out.println("move:" + files[i].renameTo(newFile));
			}

			System.out.println(i + " ok ");
		}
	}
}
